<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>编辑</title>
    <link type="text/css" rel="stylesheet" href="../../layui/css/layui.css">
    <style>
        .layui-input{
            background-color: #fff !important;
        }
        .layui-layedit{
            height:550px !important;
        }
        .layui-upload-file{
            width: 0px!important;
            height: 0px!important;
        }
        .time{
            width: 200px;
            float: left;
            position: absolute;
            bottom: 0px;
            left: 20px;
        }
        #tip_time{
            width: 50px;
            height: 30px;
            display: inline-block;
        }
        .layui-form-item .layui-form-checkbox{
            margin: 0px!important;
        }
        .layui-form-label{
            width:40px
        }
        .layui-colorpicker-trigger-i{
            display:none!important;
        }
        #editDo{
            height: 38px;
            line-height: 38px;
            position: absolute;
            bottom: 8px;
            right: 20px;
        }
        .layui-layedit{
            background-color: #fff!important;
        }
    </style>
</head>
<body>
<textarea name="myEdit" id="myEdit" rows="10" cols="80"></textarea>
<button type="button" class="layui-btn layui-btn-normal" id="editDo">保存配置</button>
<script src="../../JS/jquery-2.0.3.js"></script>
<script src="../../node_modules/ckeditor/ckeditor.js"></script>
<script>

    $(function () {
        <!-- Replace the <textarea id="myEdit"> with a CKEditor -->
        var editor = CKEDITOR.replace( 'myEdit' );
        CKEDITOR.on('instanceReady', function (e) {
            $('.cke_button__templates').click();
            //
            // this.document.on("click", AutoSave);
        });
        $('#editDo').click(function () {
            parent.$('.mouldNews'+ window.t_index).val('<div  class="m_news_add">'+editor.getData()+'</div>');
            parent.$('.mould'+window.t_index).find('.con').html('<div class="m_news_add">'+editor.getData()+'</div>');
            parent.layer.close(window.editIndex)
        })
    })
    // function AutoSave() {
    //     alert(1)
    // }

</script>
</body>
</html>